<html>
<head>
  <link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
  <div class="main">
    <h1>Namespace: joker.test</h1>
    <span class="var-added">v1.0</span>
    <h2>Contents</h2>
    <ul>
      <li>
        <a href="#_summary">Summary</a>
      </li>
      <li>
        <a href="#_index">Index</a>
      </li>
      <li>
        <a href="#_constants">Constants</a>
      </li>
      <li>
        <a href="#_variables">Variables</a>
      </li>
      <li>
        <a href="#_functions">Functions, Macros, and Special Forms</a>
      </li>
    </ul>
    <h2 id="_summary">Summary</h2>
    <p class="var-docstr">A unit testing framework.<br>
<br>
   ASSERTIONS<br>
<br>
   The core of the library is the &#34;is&#34; macro, which lets you make<br>
   assertions of any arbitrary expression:<br>
<br>
   (is (= 4 (+ 2 2)))<br>
   (is (instance? Integer 256))<br>
   (is (.startsWith &#34;abcde&#34; &#34;ab&#34;))<br>
<br>
   You can type an &#34;is&#34; expression directly at the REPL, which will<br>
   print a message if it fails.<br>
<br>
       user&gt; (is (= 5 (+ 2 2)))<br>
<br>
       FAIL in  (:1)<br>
       expected: (= 5 (+ 2 2))<br>
         actual: (not (= 5 4))<br>
       false<br>
<br>
   The &#34;expected:&#34; line shows you the original expression, and the<br>
   &#34;actual:&#34; shows you what actually happened.  In this case, it<br>
   shows that (+ 2 2) returned 4, which is not = to 5.  Finally, the<br>
   &#34;false&#34; on the last line is the value returned from the<br>
   expression.  The &#34;is&#34; macro always returns the result of the<br>
   inner expression.<br>
<br>
   There are two special assertions for testing exceptions.  The<br>
   &#34;(is (thrown? c ...))&#34; form tests if an exception of class c is<br>
   thrown:<br>
<br>
   (is (thrown? ArithmeticException (/ 1 0)))<br>
<br>
   &#34;(is (thrown-with-msg? c re ...))&#34; does the same thing and also<br>
   tests that the message on the exception matches the regular<br>
   expression re:<br>
<br>
   (is (thrown-with-msg? ArithmeticException #&#34;Divide by zero&#34;<br>
                         (/ 1 0)))<br>
<br>
   DOCUMENTING TESTS<br>
<br>
   &#34;is&#34; takes an optional second argument, a string describing the<br>
   assertion.  This message will be included in the error report.<br>
<br>
   (is (= 5 (+ 2 2)) &#34;Crazy arithmetic&#34;)<br>
<br>
   In addition, you can document groups of assertions with the<br>
   &#34;testing&#34; macro, which takes a string followed by any number of<br>
   assertions.  The string will be included in failure reports.<br>
   Calls to &#34;testing&#34; may be nested, and all of the strings will be<br>
   joined together with spaces in the final report, in a style<br>
   similar to RSpec &lt;http://rspec.info/&gt;<br>
<br>
   (testing &#34;Arithmetic&#34;<br>
     (testing &#34;with positive integers&#34;<br>
       (is (= 4 (+ 2 2)))<br>
       (is (= 7 (+ 3 4))))<br>
     (testing &#34;with negative integers&#34;<br>
       (is (= -4 (+ -2 -2)))<br>
       (is (= -1 (+ 3 -4)))))<br>
<br>
   Note that, unlike RSpec, the &#34;testing&#34; macro may only be used<br>
   INSIDE a &#34;deftest&#34; or &#34;with-test&#34; form (see below).<br>
<br>
<br>
   DEFINING TESTS<br>
<br>
   There are two ways to define tests.  The &#34;with-test&#34; macro takes<br>
   a defn or def form as its first argument, followed by any number<br>
   of assertions.  The tests will be stored as metadata on the<br>
   definition.<br>
<br>
   (with-test<br>
       (defn my-function [x y]<br>
         (+ x y))<br>
     (is (= 4 (my-function 2 2)))<br>
     (is (= 7 (my-function 3 4))))<br>
<br>
   As of Clojure SVN rev. 1221, this does not work with defmacro.<br>
   See http://code.google.com/p/clojure/issues/detail?id=51<br>
<br>
   The other way lets you define tests separately from the rest of<br>
   your code, even in a different namespace:<br>
<br>
   (deftest addition<br>
     (is (= 4 (+ 2 2)))<br>
     (is (= 7 (+ 3 4))))<br>
<br>
   (deftest subtraction<br>
     (is (= 1 (- 4 3)))<br>
     (is (= 3 (- 7 4))))<br>
<br>
   This creates functions named &#34;addition&#34; and &#34;subtraction&#34;, which<br>
   can be called like any other function.  Therefore, tests can be<br>
   grouped and composed, in a style similar to the test framework in<br>
   Peter Seibel&#39;s &#34;Practical Common Lisp&#34;<br>
   &lt;http://www.gigamonkeys.com/book/practical-building-a-unit-test-framework.html&gt;<br>
<br>
   (deftest arithmetic<br>
     (addition)<br>
     (subtraction))<br>
<br>
   The names of the nested tests will be joined in a list, like<br>
   &#34;(arithmetic addition)&#34;, in failure reports.  You can use nested<br>
   tests to set up a context shared by several tests.<br>
<br>
<br>
   RUNNING TESTS<br>
<br>
   Run tests with the function &#34;(run-tests namespaces...)&#34;:<br>
<br>
   (run-tests &#39;your.namespace &#39;some.other.namespace)<br>
<br>
   If you don&#39;t specify any namespaces, the current namespace is<br>
   used.  To run all tests in all namespaces, use &#34;(run-all-tests)&#34;.<br>
<br>
   By default, these functions will search for all tests defined in<br>
   a namespace and run them in an undefined order.  However, if you<br>
   are composing tests, as in the &#34;arithmetic&#34; example above, you<br>
   probably do not want the &#34;addition&#34; and &#34;subtraction&#34; tests run<br>
   separately.  In that case, you must define a special function<br>
   named &#34;test-ns-hook&#34; that runs your tests in the correct order:<br>
<br>
   (defn test-ns-hook []<br>
     (arithmetic))<br>
<br>
   Note: test-ns-hook prevents execution of fixtures (see below).<br>
<br>
<br>
   OMITTING TESTS FROM PRODUCTION CODE<br>
<br>
   You can bind the variable &#34;*load-tests*&#34; to false when loading or<br>
   compiling code in production.  This will prevent any tests from<br>
   being created by &#34;with-test&#34; or &#34;deftest&#34;.<br>
<br>
<br>
   FIXTURES<br>
<br>
   Fixtures allow you to run code before and after tests, to set up<br>
   the context in which tests should be run.<br>
<br>
   A fixture is just a function that calls another function passed as<br>
   an argument.  It looks like this:<br>
<br>
   (defn my-fixture [f]<br>
      Perform setup, establish bindings, whatever.<br>
     (f)  Then call the function we were passed.<br>
      Tear-down / clean-up code here.<br>
    )<br>
<br>
   Fixtures are attached to namespaces in one of two ways.  &#34;each&#34;<br>
   fixtures are run repeatedly, once for each test function created<br>
   with &#34;deftest&#34; or &#34;with-test&#34;.  &#34;each&#34; fixtures are useful for<br>
   establishing a consistent before/after state for each test, like<br>
   clearing out database tables.<br>
<br>
   &#34;each&#34; fixtures can be attached to the current namespace like this:<br>
   (use-fixtures :each fixture1 fixture2 ...)<br>
   The fixture1, fixture2 are just functions like the example above.<br>
   They can also be anonymous functions, like this:<br>
   (use-fixtures :each (fn [f] setup... (f) cleanup...))<br>
<br>
   The other kind of fixture, a &#34;once&#34; fixture, is only run once,<br>
   around ALL the tests in the namespace.  &#34;once&#34; fixtures are useful<br>
   for tasks that only need to be performed once, like establishing<br>
   database connections, or for time-consuming tasks.<br>
<br>
   Attach &#34;once&#34; fixtures to the current namespace like this:<br>
   (use-fixtures :once fixture1 fixture2 ...)<br>
<br>
   Note: Fixtures and test-ns-hook are mutually incompatible.  If you<br>
   are using test-ns-hook, fixture functions will *never* be run.<br>
<br>
<br>
   SAVING TEST OUTPUT TO A FILE<br>
<br>
   All the test reporting functions write to the var *test-out*.  By<br>
   default, this is the same as *out*, but you can rebind it to any<br>
   PrintWriter.  For example, it could be a file opened with<br>
   clojure.java.io/writer.<br>
<br>
<br>
   EXTENDING TEST-IS (ADVANCED)<br>
<br>
   You can extend the behavior of the &#34;is&#34; macro by defining new<br>
   methods for the &#34;assert-expr&#34; multimethod.  These methods are<br>
   called during expansion of the &#34;is&#34; macro, so they should return<br>
   quoted forms to be evaluated.<br>
<br>
   You can plug in your own test-reporting framework by rebinding<br>
   the &#34;report&#34; function: (report event)<br>
<br>
   The &#39;event&#39; argument is a map.  It will always have a :type key,<br>
   whose value will be a keyword signaling the type of event being<br>
   reported.  Standard events with :type value of :pass, :fail, and<br>
   :error are called when an assertion passes, fails, and throws an<br>
   exception, respectively.  In that case, the event will also have<br>
   the following keys:<br>
<br>
     :expected   The form that was expected to be true<br>
     :actual     A form representing what actually occurred<br>
     :message    The string message given as an argument to &#39;is&#39;<br>
<br>
   The &#34;testing&#34; strings will be a list in &#34;*testing-contexts*&#34;, and<br>
   the vars being tested will be a list in &#34;*testing-vars*&#34;.<br>
<br>
   Your &#34;report&#34; function should wrap any printing calls in the<br>
   &#34;with-test-out&#34; macro, which rebinds *out* to the current value<br>
   of *test-out*.<br>
<br>
   For additional event types, see the examples in the code.<br>
</p>
    <h2 id="_index">Index</h2>
    <ul class="index">
      <li>
  <a href="#*initial-report-counters*">*initial-report-counters*</a>
</li>
<li>
  <a href="#*load-tests*">*load-tests*</a>
</li>
<li>
  <a href="#*report-counters*">*report-counters*</a>
</li>
<li>
  <a href="#*stack-trace-depth*">*stack-trace-depth*</a>
</li>
<li>
  <a href="#*test-out*">*test-out*</a>
</li>
<li>
  <a href="#*testing-contexts*">*testing-contexts*</a>
</li>
<li>
  <a href="#*testing-vars*">*testing-vars*</a>
</li>
<li>
  <a href="#are">are</a>
</li>
<li>
  <a href="#assert-any">assert-any</a>
</li>
<li>
  <a href="#assert-expr">assert-expr</a>
</li>
<li>
  <a href="#assert-predicate">assert-predicate</a>
</li>
<li>
  <a href="#compose-fixtures">compose-fixtures</a>
</li>
<li>
  <a href="#deftest">deftest</a>
</li>
<li>
  <a href="#deftest-">deftest-</a>
</li>
<li>
  <a href="#do-report">do-report</a>
</li>
<li>
  <a href="#function?">function?</a>
</li>
<li>
  <a href="#get-possibly-unbound-var">get-possibly-unbound-var</a>
</li>
<li>
  <a href="#inc-report-counter">inc-report-counter</a>
</li>
<li>
  <a href="#is">is</a>
</li>
<li>
  <a href="#join-fixtures">join-fixtures</a>
</li>
<li>
  <a href="#report">report</a>
</li>
<li>
  <a href="#run-all-tests">run-all-tests</a>
</li>
<li>
  <a href="#run-tests">run-tests</a>
</li>
<li>
  <a href="#set-test">set-test</a>
</li>
<li>
  <a href="#successful?">successful?</a>
</li>
<li>
  <a href="#test-all-vars">test-all-vars</a>
</li>
<li>
  <a href="#test-ns">test-ns</a>
</li>
<li>
  <a href="#test-var">test-var</a>
</li>
<li>
  <a href="#test-vars">test-vars</a>
</li>
<li>
  <a href="#testing">testing</a>
</li>
<li>
  <a href="#testing-contexts-str">testing-contexts-str</a>
</li>
<li>
  <a href="#testing-vars-str">testing-vars-str</a>
</li>
<li>
  <a href="#try-expr">try-expr</a>
</li>
<li>
  <a href="#use-fixtures">use-fixtures</a>
</li>
<li>
  <a href="#with-test">with-test</a>
</li>
<li>
  <a href="#with-test-out">with-test-out</a>
</li>

    </ul>
    <h2 id="_constants">Constants</h2>
    Constants are variables with <tt>:const true</tt> in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.
    <ul>
      <li>
  <h3 class="Constant" id="*initial-report-counters*">*initial-report-counters*</h3>
  <span class="var-kind Constant">Constant ArrayMap</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"></pre>
  <p class="var-docstr">Used to initialize *report-counters*</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L262">source</a>
  
</li>

    </ul>
    <h2 id="_variables">Variables</h2>
    <ul>
      <li>
  <h3 class="Variable" id="*load-tests*">*load-tests*</h3>
  <span class="var-kind Variable">Boolean</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"></pre>
  <p class="var-docstr">True by default.  If set to false, no test functions will<br>
   be created by deftest, set-test, or with-test.  Use this to omit<br>
   tests when compiling or loading production code.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L238">source</a>
  
</li>
<li>
  <h3 class="Variable" id="*report-counters*">*report-counters*</h3>
  <span class="var-kind Variable">Atom</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"></pre>
  <p class="var-docstr">Bound to an atom of a map in test-ns</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L256">source</a>
  
</li>
<li>
  <h3 class="Variable" id="*stack-trace-depth*">*stack-trace-depth*</h3>
  <span class="var-kind Variable">Int</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"></pre>
  <p class="var-docstr">The maximum depth of stack traces to print when an Exception<br>
  is thrown during a test.  Defaults to nil, which means print the<br>
  complete stack trace.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L245">source</a>
  
</li>
<li>
  <h3 class="Variable" id="*test-out*">*test-out*</h3>
  <span class="var-kind Variable">IOWriter</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"></pre>
  <p class="var-docstr">PrintWriter for test reporting output</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L278">source</a>
  
</li>
<li>
  <h3 class="Variable" id="*testing-contexts*">*testing-contexts*</h3>
  <span class="var-kind Variable">List</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"></pre>
  <p class="var-docstr">Bound to hierarchy of &#34;testing&#34; strings</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L273">source</a>
  
</li>
<li>
  <h3 class="Variable" id="*testing-vars*">*testing-vars*</h3>
  <span class="var-kind Variable">List</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"></pre>
  <p class="var-docstr">Bound to hierarchy of vars being tested</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L268">source</a>
  
</li>

    </ul>
    <h2 id="_functions">Functions, Macros, and Special Forms</h2>
    <ul>
      <li>
  <h3 class="Macro" id="are">are</h3>
  <span class="var-kind Macro">Macro</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(are argv expr &amp; args)</code></div>
</pre>
  <p class="var-docstr">Checks multiple assertions with a template expression.<br>
  See clojure.template/do-template for an explanation of<br>
  templates.<br>
<br>
  Example: (are [x y] (= x y)<br>
                2 (+ 1 1)<br>
                4 (* 2 2))<br>
  Expands to:<br>
           (do (is (= 2 (+ 1 1)))<br>
               (is (= 4 (* 2 2))))<br>
<br>
  Note: This breaks some reporting features, such as line numbers.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L564">source</a>
  
</li>
<li>
  <h3 class="Function" id="assert-any">assert-any</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(assert-any msg form)</code></div>
</pre>
  <p class="var-docstr">Returns generic assertion code for any test, including macros, Java<br>
  method calls, or isolated symbols.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L445">source</a>
  
</li>
<li>
  <h3 class="Function" id="assert-expr">assert-expr</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"></pre>
  <p class="var-docstr">Don&#39;t call this; add methods to extend the &#39;is&#39; macro.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L466">source</a>
  
</li>
<li>
  <h3 class="Function" id="assert-predicate">assert-predicate</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(assert-predicate msg form)</code></div>
</pre>
  <p class="var-docstr">Returns generic assertion code for any functional predicate.  The<br>
  &#39;expected&#39; argument to &#39;report&#39; will contains the original form, the<br>
  &#39;actual&#39; argument will contain the form with all its sub-forms<br>
  evaluated.  If the predicate returns false, the &#39;actual&#39; form will<br>
  be wrapped in (not...).</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L426">source</a>
  
</li>
<li>
  <h3 class="Function" id="compose-fixtures">compose-fixtures</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(compose-fixtures f1 f2)</code></div>
</pre>
  <p class="var-docstr">Composes two fixture functions, creating a new fixture function<br>
  that combines their behavior.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L681">source</a>
  
</li>
<li>
  <h3 class="Macro" id="deftest">deftest</h3>
  <span class="var-kind Macro">Macro</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(deftest name &amp; body)</code></div>
</pre>
  <p class="var-docstr">Defines a test function with no arguments.  Test functions may call<br>
  other tests, so tests may be composed.  If you compose tests, you<br>
  should also define a function named test-ns-hook; run-tests will<br>
  call test-ns-hook instead of testing all vars.<br>
<br>
  Note: Actually, the test body goes in the :test metadata on the var,<br>
  and the real function (the value of the var) calls test-var on<br>
  itself.<br>
<br>
  When *load-tests* is false, deftest is ignored.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L614">source</a>
  
</li>
<li>
  <h3 class="Macro" id="deftest-">deftest-</h3>
  <span class="var-kind Macro">Macro</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(deftest- name &amp; body)</code></div>
</pre>
  <p class="var-docstr">Like deftest but creates a private var.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L631">source</a>
  
</li>
<li>
  <h3 class="Function" id="do-report">do-report</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(do-report m)</code></div>
</pre>
  <p class="var-docstr">Add file and line information to a test result and call report.<br>
   If you are writing a custom assert-expr method, call this function<br>
   to pass test results to report.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L341">source</a>
  
</li>
<li>
  <h3 class="Function" id="function?">function?</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(function? x)</code></div>
</pre>
  <p class="var-docstr">Returns true if argument is a function or a symbol that resolves to<br>
  a function (not a macro).</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L414">source</a>
  
</li>
<li>
  <h3 class="Function" id="get-possibly-unbound-var">get-possibly-unbound-var</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(get-possibly-unbound-var v)</code></div>
</pre>
  <p class="var-docstr">Like var-get but returns nil if the var is unbound.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L406">source</a>
  
</li>
<li>
  <h3 class="Function" id="inc-report-counter">inc-report-counter</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(inc-report-counter name)</code></div>
</pre>
  <p class="var-docstr">Increments the named counter in *report-counters*, a ref to a map.<br>
  Does nothing if *report-counters* is nil.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L312">source</a>
  
</li>
<li>
  <h3 class="Macro" id="is">is</h3>
  <span class="var-kind Macro">Macro</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(is form)</code></div>
<div><code>(is form msg)</code></div>
</pre>
  <p class="var-docstr">Generic assertion macro.  &#39;form&#39; is any predicate test.<br>
  &#39;msg&#39; is an optional message to attach to the assertion.<br>
<br>
  Example: (is (= 4 (+ 2 2)) &#34;Two plus two should be 4&#34;)<br>
<br>
  Special forms:<br>
<br>
  (is (thrown? c body)) checks that an instance of c is thrown from<br>
  body, fails if not; then returns the thing thrown.<br>
<br>
  (is (thrown-with-msg? c re body)) checks that an instance of c is<br>
  thrown AND that the message on the exception matches (with<br>
  re-find) the regular expression re.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L546">source</a>
  
</li>
<li>
  <h3 class="Function" id="join-fixtures">join-fixtures</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(join-fixtures fixtures)</code></div>
</pre>
  <p class="var-docstr">Composes a collection of fixtures, in order.  Always returns a valid<br>
  fixture function, even if the collection is empty.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L688">source</a>
  
</li>
<li>
  <h3 class="Function" id="report">report</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"></pre>
  <p class="var-docstr">Generic reporting function, may be overridden to plug in<br>
   different report formats (e.g., TAP, JUnit).  Assertions such as<br>
   &#39;is&#39; call &#39;report&#39; to indicate results.  The argument given to<br>
   &#39;report&#39; will be a map with a :type key.  See the documentation at<br>
   the top of test_is.clj for more information on the types of<br>
   arguments for &#39;report&#39;.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L322">source</a>
  
</li>
<li>
  <h3 class="Function" id="run-all-tests">run-all-tests</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(run-all-tests)</code></div>
<div><code>(run-all-tests re)</code></div>
</pre>
  <p class="var-docstr">Runs all tests in all namespaces; prints results.<br>
  Optional argument is a regular expression; only namespaces with<br>
  names matching the regular expression (with re-matches) will be<br>
  tested.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L772">source</a>
  
</li>
<li>
  <h3 class="Function" id="run-tests">run-tests</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(run-tests)</code></div>
<div><code>(run-tests &amp; namespaces)</code></div>
</pre>
  <p class="var-docstr">Runs all tests in the given namespaces; prints results.<br>
  Defaults to current namespace if none given.  Returns a map<br>
  summarizing test results.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L760">source</a>
  
</li>
<li>
  <h3 class="Macro" id="set-test">set-test</h3>
  <span class="var-kind Macro">Macro</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(set-test name &amp; body)</code></div>
</pre>
  <p class="var-docstr">Experimental.<br>
  Sets :test metadata of the named var to a fn with the given body.<br>
  The var must already exist.  Does not modify the value of the var.<br>
<br>
  When *load-tests* is false, set-test is ignored.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L640">source</a>
  
</li>
<li>
  <h3 class="Function" id="successful?">successful?</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(successful? summary)</code></div>
</pre>
  <p class="var-docstr">Returns true if the given test summary indicates all tests<br>
  were successful, false otherwise.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L781">source</a>
  
</li>
<li>
  <h3 class="Function" id="test-all-vars">test-all-vars</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(test-all-vars ns)</code></div>
</pre>
  <p class="var-docstr">Calls test-vars on every var interned in the namespace, with fixtures.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L729">source</a>
  
</li>
<li>
  <h3 class="Function" id="test-ns">test-ns</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(test-ns ns)</code></div>
</pre>
  <p class="var-docstr">If the namespace defines a function named test-ns-hook, calls that.<br>
  Otherwise, calls test-all-vars on the namespace.  &#39;ns&#39; is a<br>
  namespace object or a symbol.<br>
<br>
  Internally binds *report-counters* to a ref initialized to<br>
  *initial-report-counters*.  Returns the final, dereferenced state of<br>
  *report-counters*.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L735">source</a>
  
</li>
<li>
  <h3 class="Function" id="test-var">test-var</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(test-var v)</code></div>
</pre>
  <p class="var-docstr">If v has a function in its :test metadata, calls that function,<br>
  with *testing-vars* bound to (conj *testing-vars* v).</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L700">source</a>
  
</li>
<li>
  <h3 class="Function" id="test-vars">test-vars</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(test-vars vars)</code></div>
</pre>
  <p class="var-docstr">Groups vars by their namespace and runs test-vars on them with<br>
   appropriate fixtures applied.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L715">source</a>
  
</li>
<li>
  <h3 class="Macro" id="testing">testing</h3>
  <span class="var-kind Macro">Macro</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(testing string &amp; body)</code></div>
</pre>
  <p class="var-docstr">Adds a new string to the list of testing contexts.  May be nested,<br>
  but must occur inside a test function (deftest).</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L589">source</a>
  
</li>
<li>
  <h3 class="Function" id="testing-contexts-str">testing-contexts-str</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(testing-contexts-str)</code></div>
</pre>
  <p class="var-docstr">Returns a string representation of the current test context. Joins<br>
  strings in *testing-contexts* with spaces.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L305">source</a>
  
</li>
<li>
  <h3 class="Function" id="testing-vars-str">testing-vars-str</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(testing-vars-str m)</code></div>
</pre>
  <p class="var-docstr">Returns a string representation of the current test.  Renders names<br>
  in *testing-vars* as a list, then the source file and line of<br>
  current assertion.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L292">source</a>
  
</li>
<li>
  <h3 class="Macro" id="try-expr">try-expr</h3>
  <span class="var-kind Macro">Macro</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(try-expr msg form)</code></div>
</pre>
  <p class="var-docstr">Used by the &#39;is&#39; macro to catch unexpected exceptions.<br>
  You don&#39;t call this.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L530">source</a>
  
</li>
<li>
  <h3 class="Function" id="use-fixtures">use-fixtures</h3>
  <span class="var-kind Function">Function</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"></pre>
  <p class="var-docstr">Wrap test runs in a fixture function to perform setup and<br>
  teardown. Using a fixture-type of :each wraps every test<br>
  individually, while :once wraps the whole run in a single function.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L662">source</a>
  
</li>
<li>
  <h3 class="Macro" id="with-test">with-test</h3>
  <span class="var-kind Macro">Macro</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(with-test definition &amp; body)</code></div>
</pre>
  <p class="var-docstr">Takes any definition form (that returns a Var) as the first argument.<br>
  Remaining body goes in the :test metadata function for that Var.<br>
<br>
  When *load-tests* is false, only evaluates the definition, ignoring<br>
  the tests.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L601">source</a>
  
</li>
<li>
  <h3 class="Macro" id="with-test-out">with-test-out</h3>
  <span class="var-kind Macro">Macro</span>
  <span class="var-added">v1.0</span>
  <pre class="var-usage"><div><code>(with-test-out &amp; body)</code></div>
</pre>
  <p class="var-docstr">Runs body with *out* bound to the value of *test-out*.</p>
  <a href="https://github.com/candid82/joker/blob/master/core/data/test.joke#L283">source</a>
  
</li>

    </ul>
  </div>
</body>
<script src="main.js"></script>
</html>
